﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Tap
{
    public partial class Tap : UserControl
    {
        //阀门
        private bool waterValue = false;
        public bool WaterValue
        {
            get { return waterValue; }
            set {
                waterValue = value;
                if(waterValue)
                {
                    pictureBox1.Image = Properties.Resources.openvalve;
                }
                else
                {
                    pictureBox1.Image = Properties.Resources.valve;
                }
            }
        }
        public Tap()
        {
            InitializeComponent();
            pictureBox1.Image = Properties.Resources.valve;

        }
        public event EventHandler WaterValueControl;
        private void pictureBox1_DoubleClick(object sender, EventArgs e)
        {
            if(WaterValueControl != null)
            {
                WaterValueControl(sender, new EventArgs());
            }
         
        }
    }
}
